<html>
<head>
    <link href="${ctx}/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx}/font-awesome/3.0.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.css" rel="stylesheet">
    <link href="${ctx}/css/index.css" rel="stylesheet">
    <script src="${ctx}/jquery/2.1.4/jquery.min.js"></script>
    <script src="${ctx}/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.js"></script>
    <style>
        [class^="col-"] {
            vertical-align: middle;
            line-height: 34px;
            min-height: 34px;
            margin-bottom: 0;
        }

        .form-control-static {
            padding: 0;
            margin: 0;
        }

        .row {
            margin-bottom: 15px;
        }

    </style>

</head>
<body class="container" style="height: 240px;">
<div class="eidt_password">
    <div class="row">
        <div class="col-xs-12">
            <input type="password" id="pass" class="form-control" placeholder="请输入新密码">
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <input type="password" id="again" class="form-control" placeholder="再次输入新密码">
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <input id="save" type="button" style="width:100%;" class="btn btn-success" value="确定">
        </div>
    </div>
</div>

<script>
    $(function () {
        $("#save").click(function () {
            var pass = $("#pass").val();
            var again = $("#again").val();
            if (pass.length < 6) {
                alert("密码至少6位！");
                return false;
            }
            if (pass != again) {
                alert("密码不一致！");
                return false;
            }
            $.post('/user/updatepass', {
                password: pass
            }, function (res) {
                alert(res);
            });
        });
    });
</script>
</body>
</html>
